<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			.flex-container {
				display: -webkit-flex;
				display: flex;
				width: 400px;
				height: 250px;
				background-color: lightgrey;
				flex-direction: row;
				justify-content: center; /*水平方向*/
				align-items: center;/*垂直方向*/
				flex-wrap: wrap;
				align-content: center;
				margin: 10px;
			}

			.flex-item {
				background-color: cornflowerblue;
				width: 100px;
				height: 100px;
				margin: 10px;
			}

			body {
				/*direction: rtl;常用值rtl和ltr*/
				/* direction: rtl; */
			}
		</style>
	</head>
	<body>
		<div class="flex-container">
			<div class="flex-item">flex item 1</div>
			<div class="flex-item">flex item 2</div>
			<div class="flex-item">flex item 3</div>
			<div class="flex-item">flex item 4</div>
			<div class="flex-item">flex item 5</div>
			<div class="flex-item">flex item 6</div>
		</div>

		<div class="flex-container">
			<div class="flex-item">flex item 1</div>
			<div class="flex-item">flex item 2</div>
			<div class="flex-item">flex item 3</div>
		</div>
	</body>
</html>
